package com.lvmama.config.test;

import java.io.IOException;
import java.net.InetSocketAddress;
import java.net.Socket;
import java.net.URLEncoder;

/**
 * Created by troy on 2016/7/19.
 * kouhongyu@163.com
 */
public class ConfigUtil {

    public static String localIPs() throws IOException {
        InetSocketAddress contextPath = new InetSocketAddress("192.168.0.83", 2181);
        Socket socket = new Socket();
        socket.connect(contextPath, 1000);

        String ip = socket.getLocalAddress().getHostAddress();

        socket.close();

        return ip;
    }

    public static void main(String[] args) throws IOException {
        System.out.println( URLEncoder.encode("disabled"+"="+Boolean.TRUE.toString(),"UTF-8"));
    }

}
